package com.tange.ai.iot.client.gnssa.lan

import android.content.Intent
import android.graphics.Color
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.tange.ai.iot.client.gnssa.databinding.ActivityLanConnectTypeChooseBinding
import com.tange.base.toolkit.onClicked
import com.tange.base.ui.design.BasicDialogRequest

class LanConnectWaysActivity: AppCompatActivity() {

    private lateinit var binding: ActivityLanConnectTypeChooseBinding

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        binding = ActivityLanConnectTypeChooseBinding.inflate(layoutInflater).apply {
            setContentView(root)
            supportActionBar?.hide()
        }

        com.tange.ai.iot.client.gnssa.utils.Utils.setStatusBar(this, Color.TRANSPARENT)

        binding.byApScan.onClicked {
            BasicDialogRequest(this@LanConnectWaysActivity).apply {
                setMessage("确保设备已经进入本地直连模式后，再点击下一步")
                setPositiveText("下一步")
                setPositiveOnClicked {
                    startActivity(Intent(this@LanConnectWaysActivity, LanApScanActivity::class.java))
                    dismiss()
                }
            }.show()
        }

        binding.bySpecify.onClicked {
            startActivity(Intent(this@LanConnectWaysActivity, LanConfigureActivity::class.java))
        }
    }
}